package parkshop.pmcourse.dto;

import parkshop.pmcourse.domain.Customer;
import parkshop.pmcourse.domain.MallAdministrator;
import parkshop.pmcourse.domain.ShopOwner;
import parkshop.pmcourse.utils.ConstantUtil;

/*
 *  High level user ,
 *  save user info in session
 */
public class User {

		private Long id;
	    private String name;
	    private String password;
	    private String phone;
	    private String type;// "customer"  "shopOwner"  "administrator"
	    private String address;
	    private Byte issuspended;
	    private String activeCode;
		private Byte isActived;
		private String mail;
		private String imgUrl;
	    
	   
		public String getMail() {
			return mail;
		}
		public void setMail(String mail) {
			this.mail = mail;
		}
		public String getActiveCode() {
			return activeCode;
		}
		public void setActiveCode(String activeCode) {
			this.activeCode = activeCode;
		}
		public Byte getIsActived() {
			return isActived;
		}
		public void setIsActived(Byte s) {
			this.isActived = s;
		}
		public User(){}
	    public User(Customer customer){
	    	id=customer.getId();
	    	name=customer.getName();
	    	password=customer.getPassword();
	    	phone=customer.getPhone();
	    	type=ConstantUtil.userTypeCustomer;
	    	this.address = customer.getAddress();
	    }
	    public User(ShopOwner shopOwner){
	    	id=shopOwner.getId();
	    	name=shopOwner.getName();
	    	password=shopOwner.getPassword();
	    	phone=shopOwner.getPhone();
	    	type=ConstantUtil.userTypeShopOwner;
	    }
	    public User(MallAdministrator admin){
	    	id=admin.getId();
	    	name=admin.getName();
	    	password=admin.getPassword();
	    	type=ConstantUtil.userTypeAdministrator;
	    }
	    public String getAddress() {
			return address;
		}
		public void setAddress(String address) {
			this.address = address;
		}
		public Byte getIssuspended() {
			return issuspended;
		}
		public void setIssuspended(Byte issuspended) {
			this.issuspended = issuspended;
		}
		public Long getId() {
			return id;
		}
		public void setId(Long id) {
			this.id = id;
		}
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public String getPassword() {
			return password;
		}
		public void setPassword(String password) {
			this.password = password;
		}
		public String getPhone() {
			return phone;
		}
		public void setPhone(String phone) {
			this.phone = phone;
		}
		public String getType() {
			return type;
		}
		public void setType(String type) {
			this.type = type;
		}
		public String getImgUrl() {
			return imgUrl;
		}
		public void setImgUrl(String imgUrl) {
			this.imgUrl = imgUrl;
		}
	    

}
